<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/6/11
 * Time: 16:27
 */

namespace app\admin\controller;


use app\common\controller\AdminBaseController;
use app\common\ext\IDb;
use app\common\ext\IRequest;

class UserShop extends AdminBaseController {
    /**
     * @功能 获取网店信息
     * @开发者 yy
     */
    public function user_shop_list(){
        //获取参数
        $user_id = IRequest::get('user_id');
        $business_year = IRequest::get('business_year');

        //获取网店信息
        $where = null;
        if(!empty($user_id)) $where['user_id'] = $user_id;
        if(!empty($business_year)) $where['business_year'] = $business_year;
        $user_shop_list = IDb::getInstance('asset_shop')->setDbWhere($where)->pag();

        //页面赋值
        $this->assign('user_shop_list', $user_shop_list);
        $this->assign('user_id', $user_id);
        $this->assign('business_year', $business_year);

        //页面显示
        return view();

    }

    /**
     * @功能 获取网店的详情信息
     * @开发者 yy
     */
    public function user_shop_info(){
        //参数的获取
        $user_shop_id = IRequest::get('user_shop_id', IRequest::NOT_EMPTY, '商店编号不能为空');

        //获取网店信息
        $where = null;
        $where['user_shop_id'] = $user_shop_id;
        $user_shop_info = IDb::getInstance('asset_shop')->setDbWhere($where)->row();

        //设置layout
        $this->layout("layout_empty");

        //页面赋值
        $this->assign('user_shop_info', $user_shop_info);

        //页面显示
        return view();
    }

}